home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / os2 / werwolf.zip / werwolf / gamesrvr.doc < prev    next >
Text File  |  1995-09-19  |  5KB  |  132 lines

  1. GAMESRVR.DLL -- Full-screen support for DIVE game applications           
  2.  
  3. Overview: 
  4. ---------
  5.  
  6. The purpose of the GameSrvr is to support games in video modes other
  7. than that used by the OS/2 desktop.  The reason for this is quite
  8. simple:  SPEED.
  9.  
  10. Most games on the market today use the 320x200x256 VGA mode.  There are
  11. a number of reasons for using this mode that outweigh the mediocre
  12. resolution of 320 by 200 pels in 256 colors.
  13.  
  14.   Compatibility:  This mode exists on all VGA and SuperVGA cards.
  15.  
  16.   Ease of Use:  This mode uses a flat frame buffer and exactly one byte
  17.      per pel.  This greatly simplifies the coding of graphics routines,
  18.      since hardware registers and bit packing can be ignored.
  19.  
  20.   Speed:  Not only are the graphics algorithms faster due to their
  21.      simplicity, but the buffer is only 64000 bytes.  Compare this to a
  22.      typical desktop resolution of 1024x768x256 with a frame buffer of
  23.      786432 bytes, more than 12 times larger and slower.  If the
  24.      resolution or number of colors is increased, this will only get
  25.      worse.
  26.  
  27. By using the functions provided by the GameSrvr, PM programs can be
  28. written to use the full screen without paying the penalty of a large
  29. frame buffer.
  30.  
  31. Installation and Use: 
  32. ---------------------
  33.  
  34. To install the GameSrvr, run GSRVINST.EXE to perform the following
  35. steps:
  36.  
  37.   Copy GAMESRVR.DLL and DIVE.DLL to d:\OS2\DLL, where d is the boot
  38.   drive.
  39.  
  40.   Add the GAMESRVR key to the PM_ED_HOOKS application in OS2.INI with
  41.   the key value of d:\OS2\DLL\GAMESRVR.DLL, where d is the boot drive.
  42.  
  43.   If SVGADATA.PMI exists in the d:\OS2 directory, copy SVGA.EXE to
  44.   d:\OS2, then execute SVGA ON INIT to rebuild the SVGADATA.PMI file,
  45.   adding the 320x200x256 mode.
  46.  
  47. Depending on the video card that you have installed, the installation may
  48. end in the full-screen DOS session where SVGA.EXE was executed.  If so,
  49. you should type EXIT to return to your OS/2 session.
  50.  
  51. The system will have to be rebooted to allow these changes to take
  52. effect.  Applications written to use the GameSrvr will automatically
  53. take advantage of its presence.
  54.  
  55. Once an application has initialized with GameSrvr, the user can switch
  56. to full screen mode by hitting "ALT + HOME" ( Only the home key on the
  57. key pad will work ). This mechanism is supported by GameSrvr directly.
  58. An application can also provide a user interface that takes advantage
  59. of GameSrvr APIs to switch to full screen mode.
  60.  
  61.  
  62.  
  63.  
  64. Programming: 
  65. ------------
  66.  
  67. The GameSrvr is loaded at execution time by performing a DosLoadModule
  68. on GAMESRVR.  If this is successful, the address of the
  69. InitGameFrameProc routine my be queried using DosQueryProcAddr.  When
  70. you call this routine with the handle of the frame window of the
  71. application, it subclasses the frame window procedure.  This allows the
  72. GameSrvr to process all messages sent to the application, especially
  73. focus change messages which may require restoration of the original
  74. desktop mode.
  75.  
  76. Communication with the GameSrvr is through the following three messages:
  77.  
  78.   WM_SetVideoMode (0x04A0)
  79.  
  80.     This message uses mp1 to select either one of the preset game window
  81.     styles or a specific video mode, as extracted from the table of
  82.     supported video modes.
  83.  
  84.     mp1 == 0 restores the original mode of the desktop, as well as the
  85.              original size and location of the application's window.
  86.  
  87.     mp1 == 1 restores the original mode of the desktop, but expands the
  88.              size of the client window so that only the client window
  89.              and the command bar are visible.
  90.  
  91.     mp1 == 2 expands the client window to fill the screen, then sets the
  92.              video mode to the standard 320x200x256 game mode.
  93.  
  94.     mp1 > 2 expands the client window to fill the screen, then sets the
  95.              video mode defined by the VIDEOMODEINFO structure addressed
  96.              by mp1.
  97.  
  98.     The return value from this message is 1, if successful, otherwise 0.
  99.  
  100.   WM_NotifyVideoModeChange (0x04A1)
  101.  
  102.     This message is generated by the GameSrvr to notify the application
  103.     immediately before and again immediately after a video mode change.
  104.  
  105.     mp1 == 0 indicates that the video mode is about to change.
  106.  
  107.     mp1 == 1 indicates that the video mode change is complete.
  108.  
  109.     In both cases, mp2 contains the address of the VIDEOMODEINFO
  110.     structure which describes the video mode or 0 or 1, as described for
  111.     the WM_SetVideoMode message.  The value of 2 will never be returned.
  112.     Instead it is transformed into a pointer to a VIDEOMODEINFO
  113.     structure.
  114.  
  115.     The return value of this message is ignored.
  116.  
  117.   WM_GetVideoModeTable (0x04A2)
  118.  
  119.     This message is used only if you wish to select a video mode other
  120.     than the standard 320x200x256 mode.
  121.  
  122.     mp1 is the address of a PVOID to receive the address of an array of
  123.              VIDEOMODEINFO structures describing all of the modes
  124.              supported by the current display card.  This array is
  125.              allocated for you.  You may delete it yourself or allow it
  126.              to be automatically deleted at process termination.
  127.  
  128.     mp2 is the address of a ULONG to receive the number of structures in
  129.              the array that was allocated.
  130.  
  131.     The return value from this message is 1, if successful, otherwise 0.
  132.